<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition template="/template.xhtml"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:p="http://primefaces.org/ui"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:c="http://java.sun.com/jsp/jstl/core">
    <ui:define name="title">
        <h:outputText value="#{bundle.CreatecurrentTitle}"></h:outputText>
    </ui:define>
    <ui:define name="body">
        <h:form id="form" styleClass="form">
            <p:fieldset id="current"  legend="Fasta Details"  >
                <p:focus/>
                <p:fieldset legend="Upload Fasta" >
                    <br/>
                    <h:outputLabel value="Associate With" styleClass="engraved" />
                    <p:spacer width="20"/>
                    <p:selectOneMenu  value="#{projectController.current}"  required="true" requiredMessage="#{bundle.CreateGenBankRequiredMessage_prjFk}">
                        <f:selectItems var="prj" value="#{projectController.items}" itemLabel="#{prj.prjName}" itemValue="#{prj}" transient="true" />
                    </p:selectOneMenu>
                    <br/>
                    <p:fileUpload fileUploadListener="#{projectController.handleFileUploadFastas}"
                                  mode="advanced"
                                  multiple="true"
                                  immediate="false"
                                  sizeLimit="300000000"
                                  auto="false"
                                  uploadLabel="Send"
                                  showButtons="true"
                                  update="@form"

                                  >
                    </p:fileUpload>
                    <p:commandButton ajax="false" actionListener="#{projectController.tmp_list_fasta.clear()}" value="Clear All" immediate="true"/>
                    <p:dataGrid id="files" var="f"  value="#{projectController.tmp_list_fasta}" emptyMessage="No Files found">
                        <center>
                            <p:column >
                                    <div class="item_on_list" >
                                        <p:selectBooleanCheckbox  itemLabel="#{f.defline}"/>
                                    </div>
                            </p:column>
                        </center>
                    </p:dataGrid>
                </p:fieldset>
                <p:commandButton ajax="false" action="#{projectController.importFastas(projectController.tmp_list_fasta, userController.loggedUser)}" value="#{bundle.CreateFastaSaveLink}" process="@form" update="@form" />
                <p:commandButton ajax="false" action="#{fastaController.prepareList()}" value="Show All" immediate="true"/>
            </p:fieldset>
        </h:form>
    </ui:define>
</ui:composition>


